package dao;

import entity.User;

import java.sql.SQLException;
import java.util.List;

public interface UserDao {
    //查询此人是否存在 true此人存在 false此人不存在
    public boolean isExist(String userId) throws SQLException;

    //添加用户
    public boolean addUser(User user) throws SQLException;

    //查询全部用户
    public List<User> queryAllUsers() throws SQLException;

    //根据条件查询全部用户
    public List<User> queryAllUsersByRequire(String sql,Object[] params) throws SQLException;

    //根据用户Id查人
    public User queryStudentById(String userId) throws SQLException;

    //根据用户Id删除用户
    public boolean deleteUserById(String userId) throws SQLException;

    //根据用户Id修改用户
    public boolean updateUserById(String userId,User user) throws SQLException;

    //查询总数据数
    public int getTotalCount(String sql,Object[] params) throws SQLException;

    //查询当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<User> queryUserByPage(int currentPage,int pageSize) throws SQLException;

    //根据账号或姓名查询当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<User> queryUserByPageRequire(int currentPage,int pageSize,Object param) throws SQLException;

}
